#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int sumOfSquares(vector<int>& nums) {
        int size = nums.size();
        int sum = 0;
        for (int i = 0; i < size; ++i)
        {
            if (size % (i + 1) == 0)
            {
                sum += pow(nums[i], 2);
            }

        }

        return sum;
    }
};